<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>视频播放</title>
    <link rel="stylesheet" href="\layui-v2.5.6\layui\css\layui.css" media="all">
    <script src="layui-v2.5.6\layui\layui.js" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="bootstrap\bootstrap.min.css"/>
    <script src="bootstrap\jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="bootstrap\popper.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="bootstrap\bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="vue\axios.js"></script>
    <script src="vue\Vue.js"></script>
</head>
<body>
    <div id="app">
       <div style="float: left">
           <video width="500" height="300" controls autoplay id="video" style="margin: 20px 20px auto">
               <source :src="videos.path" :type="videos.path">
           </video>
       </div>
        <div style="float: left">
           <div style="margin: 30px 25px ; font-size: 12px" >
               <p>上传时间:
                   <label>{{videos.date}}</label>
               </p>
               <p>知识点:
                   <label>{{videos.knowledge}}</label>
               </p>
               <p>
                   内容类型:
                   <label>{{videos.content}}</label>
               </p>
           </div>
            <div>
                <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label" style="font-size: 12px">审核:</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="close" lay-skin="switch" lay-text="ON|OFF" lay-filter="switchTest">
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
</body>
<script>
    var message = window.location.href.split("=")[1];
    var vid = message.split(",")[0];
    var examine = 0;
    layui.use(['form'], function(){
        var form = layui.form
            ,layer = layui.layer;

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('授权：'+ (this.checked ? 'true' : 'false'), {
            });
            //获取授权--开关是否开启
            console.info(this.checked)
            layer.tips('温馨提示：好好审核', data.othis)

            if (this.checked == true){
                examine = 1;
            }

            $.ajax({
                url:'audit/video/'+vid+"/"+examine
                ,type:'post'
                ,dataType:'json'
                ,success:function (data) {
                    alert(data)
                }
            });
        });
    })
    new Vue({
        el:"#app"
        ,data:{
            videos:"",
        }
        ,mounted(){

            alert(vid)
            axios
                .get("audit/findByVid/"+vid)
                .then(res=>{
                    console.info(res.data)
                    this.videos = res.data.data;
                });
        }
    });

</script>
</html>